{include file='header.html'}
 <div class="table"> 
      <div class="row">
          <span class="td4 h1top">
<h1>Изменить данные профиля</h1>
<div class="form">
<form method="post" action="{geturl action='editprofile'}" id="editprofile-form">

        <div class="error"{if !$fp->hasError()} style="display: none"{/if}>
            Одно или несколько полей заполнены неверно. Проверьте, пожалуйста, 
            поля с ошибками и отправьте форму ещё раз.
        </div>

        <div class="row" id="form_username_container">
            <span class="td4" style="width:200px;padding-top: 5px;">     <label for="form_username">Логин:</label></span>
              <span class="td4" style="padding: 5px;"> <input type="text" id="form_username"
                   name="login" value="{$fp->login|escape}" />
                  {include file='lib/error.tpl' error=$fp->getError('login')}</span>
        </div>
        
        <div class="row" id="form_password_container">
            <span class="td4" style="width:200px;padding-top: 5px;"> <label for="form_password">Пароль:</label></span>
             <span class="td4" style="padding: 5px;"><input type="password" id="form_password"
                   name="password" value="{$fp->password|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('password')}</span>
        </div>
        
        <div class="row" id="form_password_again_container">
          <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_email">Подтвердите пароль:</label></span>
            <span class="td4" style="padding: 5px;"> <input type="password" id="form_password_again"
                   name="password_again" value="{$fp->password_again|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('password_again')}</span>
        </div>

        <div class="row" id="form_first_name_container">
            <span class="td4" style="width:200px;padding-top: 5px;"> <label for="form_company">Предприятие:</label></span>
            <span class="td4" style="padding: 5px;"> <input type="text" id="form_company"
                   name="company" value="{$fp->company|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('company')}</span>
        </div>

       <div class="row" id="form_region_container">
            <span class="td4" style="width:200px;padding-top: 5px;"> <label for="form_region">Область:</label></span>
            <span class="td4" style="padding: 5px;"><select name='region' id='form_region' onchange="region_city()" data-placeholder="Выбрать область" class="chosen-select_project" style="width:300px;" tabindex="4">
          
            {foreach from=$regions item=region}
            {if $region->getId()== $fp->region}
            <option value="{$region->getId()}" selected='selected'>{$region->name}</option>
            {else}
            <option value="{$region->getId()}">{$region->name}</option>
            {/if}
            {/foreach}
            </select>
            {include file='lib/error.tpl' error=$fp->getError('region')}</span>
        </div>
        
        <div class="row" id="form_city_container">
            <span class="td4" style="width:200px;padding-top: 5px;"> <label for="form_city">Город:</label></span>
          <span class="td4" style="padding: 5px;">   <span id="cities">{if $fp->cities} 
            <select name='city' id='form_city' data-placeholder="Выбрать город" class="chosen-select_city" style="width:300px;" tabindex="4">
            <option value='0'></option>
            {foreach from=$fp->cities item=city}
            {if $city->getId()== $fp->city}
            <option value="{$city->getId()}" selected='selected'>{$city->name}</option>
            {else}
            <option value="{$city->getId()}">{$city->name}</option>
            {/if}
            {/foreach}
            </select>
              {/if}<span>
            {include file='lib/error.tpl' error=$fp->getError('city')}</span>
        </div>
        
        <div class="row" id="form_adress_container">
           <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_adress">Юридический адрес:</label></span>
             <span class="td4" style="padding: 5px;"><input type="text" id="form_adress"
                   name="adress" value="{$fp->adress|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('adress')}</span>
        </div>
        
        <div class="row" id="form_real_adress_container">
           <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_real_adress">Фактический адрес:</label></span>
            <span class="td4" style="padding: 5px;"> <input type="text" id="form_adress"
                   name="real_adress" value="{$fp->real_adress|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('real_adress')}</span>
        </div>
        
        <div class="row" id="form_company_phone_container">
           <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_company_phone">Телефон:</label></span>
           <span class="td4" style="padding: 5px;">  <input type="text" id="form_company_form"
                   name="company_phone" value="{$fp->company_phone|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('company_phone')}</span>
        </div>
        
        <div class="row" id="form_code_container">
           <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_code">Код ОКПОУ:</label></span>
            <span class="td4" style="padding: 5px;"> <input type="text" id="form_code"
                   name="code" value="{$fp->code|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('code')}</span>
        </div>
        
        <div class="row" id="form_password_again_container">
          <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_email">Выберите категории:</label></span>
          <span class="td4" style="padding: 5px;">   {foreach from=$cats item='cat'}
                {assign var=checked value=0}
                {foreach from=$fp->user->categories item=c}
                    {if $c->idCat == $cat->getId()}
                        {assign var=checked value=1}
                    {/if}
                {/foreach}
                <input type='checkbox' name='cats[]' value='{$cat->getId()}' {if $checked == 1} checked='checked'{/if} /> {$cat->name|escape}
            {/foreach}
            {include file='lib/error.tpl' error=$fp->getError('category')}</span>
        </div>
        
        <div class="row" id="form_email_container">
          <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_email">E-mail:</label></span>
          <span class="td4" style="padding: 5px;">   <input type="text" id="form_email"
                   name="email" value="{$fp->email|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('email')}</span>
        </div>
        
        <div class="row" id="form_manager_container">
          <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_manager">Контактное лицо:</label></span>
           <span class="td4" style="padding: 5px;">  <input type="text" id="form_manager"
                   name="manager" value="{$fp->manager|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('manager')}</span>
        </div>
        
        <div class="row" id="form_post_container">
          <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_post">Должность:</label></span>
           <span class="td4" style="padding: 5px;">  <input type="text" id="form_post"
                   name="post" value="{$fp->post|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('post')}</span>
        </div>
        
        <div class="row" id="form_phone_container">
           <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_phone">Телефон:</label></span>
          <span class="td4" style="padding: 5px;">   <input type="text" id="form_form"
                   name="phone" value="{$fp->phone|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('phone')}</span>
        </div>

        <div class="submit">
            <input type="submit" value="Сохранить" />
        </div>
 
</form>
</div>
          </span> 
<span class="td5 linedt5">
<div class="botline mgbkmen"></div>
<a href="{geturl action='index'}" {if $usermenu=='index'}class="blockmenuact"{else}class="blockmenu"{/if}>Главная личного кабинета</a>
<a href="{geturl action='editprofile'}" {if $usermenu=='editprofile'}class="blockmenuact"{else}class="blockmenu"{/if}>Редактировать данные профиля</a>
<a href="{geturl action='myrequests'}" {if $usermenu=='myrequests'}class="blockmenuact"{else}class="blockmenu"{/if}>Мои заявки</a>

<a href="{geturl action='index' controller='index'}" class="blockmenu" >Вернуться на сайт</a>
</span>
            
     
      </div>
     </div>
{include file='footer.html'}